Homework of this week

Classifiers: using a k-Nearest Neighbour, Decision Tree and Random Forest classifier to predict which song belongs to the album it’s from.

Here we have three classifying methodes; kNN, decision tree and random forest, attempting to distinguish the two albums by Frusciante I’m comparing. The most importent features are:

  • Timbre component 1
  • Timbre component 2
  • Timbre component 12
  • loudness
  • energy

The predictions sometimes slightly change (usually by one or two) when I rerun the code, so it is possible the subtext differs from the corresponding heatmap.

K-Nearest Neighbours


This heat map shows the performance of a kNN classifier. As you can see, Spotify did a near perfect job on predicting the songs for Niandra LaDes and Usually Just A T-Shirt, but wrongly predicted about a third of the songs for To Record Only Water For Ten Days. I’d love to be able to see which songs were wrongly predicted, anyone know where I can see that?

Decision Tree


This second classifier is done by the decision tree method. The predictions for Niandra LaDes and Usually Just A T-Shirt are apparently the same as the kNN classifier, but it performed better than the kNN when it predicted the songs To Record Only Water For Ten Days, only getting one song wrong.

Random Forest


The last classifier I’m using is the random forest classifier. As you can see it perfomed the best out of the three, getting only one prediction wrong for both albums.

Introduction

How About Some Revalidation Spotify? Comparing the decent and recovery of John Frusciante through music.

John Frusciante is American musician best known as the guitarist of The Red Hot Chili Peppers (RHCP). Besides his work for the RHCP, he has had an accomplished and diverse solo career. In 1992 he left RHCP for the first time and released his debut solo album two years later, in November 1994. The album consists of two parts: Niandra LaDes and Usually Just A T-Shirt. Niandra LaDes was mostly recorded during the writing and recorded of RHCP album Blood Surgar Sex Magic, only “Running Away With You” was recorded after quitting the band. Usually Just A T-Shirt was recorded while the band was on tour in the months leading up to Frusciante’s departure and it appears in the order it was recorded. It was during these months that his use of cocaine and heroin became more extreme. Frusciante said himself in an interview that he can hear his decline into hard drugs in the songs: “It’s very sad because I hear, when I listen to it [the last two songs on the record], that it sounds like a person falling apart or it sounds like somebody about to kill themselves”. It wasn’t until January 1998 that Frusciante was admitted to rehab. He checked out and re-entered society about a month later. The same year Frusciante rejoined RHCP, released a new album with them and went on tour. During the tour he composed new material for his first solo record after rehabilitation, To Record Only Water For Ten Days. What I would like to research in this corpus, is what Spotify’s API can tell us about the differences in his album before rehabilitation, Niandra Lades and Usually Just A T-Shirt (NLDAUJATS), and after rehabilitation, To Record Only Water For Ten Days (TROWFTD).

The Album Covers

Comparing both albums

Scatterplot

Bar Chart of Vitality


On the left we have two bar charts, one measuring the valence and one measuring the energy on the two albums. As one would predict after listening to the albums, To Record Only Water For Ten Days beats Niandra Lades and Usually Just A T-Shirt on both accounts, especially in energy. What I find interesting, is that Niandra Lades and Usually Just A T-Shirt has 10 more songs than To Record Only Water For Ten Days, but still loses the fight. This shows how much more energetic and positive Spotify (and I can’t help but agree) finds the latter album.

Histogram of Tempo Differences

# A tibble: 1 x 1
  mean_tempo
       <dbl>
1       112.
# A tibble: 1 x 1
  mean_tempo
       <dbl>
1       113.

Comparing the Keys

Key Track Album
A major Untitled #7 Niandra LaDes And Usually Just A T-Shirt
A major Moments Have You To Record Only Water For Ten Days (U.S. Version)
A minor My Smile Is A Rifle Niandra LaDes And Usually Just A T-Shirt
A minor Untitled #5 Niandra LaDes And Usually Just A T-Shirt
A minor Untitled #11 Niandra LaDes And Usually Just A T-Shirt
A minor Untitled #12 Niandra LaDes And Usually Just A T-Shirt
A minor Invisible Movement To Record Only Water For Ten Days (U.S. Version)
A minor In Rime To Record Only Water For Ten Days (U.S. Version)
A minor Saturation To Record Only Water For Ten Days (U.S. Version)
A# minor Ramparts To Record Only Water For Ten Days (U.S. Version)
B major Untitled #1 Niandra LaDes And Usually Just A T-Shirt
B major Untitled #6 Niandra LaDes And Usually Just A T-Shirt
B minor As Can Be Niandra LaDes And Usually Just A T-Shirt
B minor Running Away Into You Niandra LaDes And Usually Just A T-Shirt
B minor Away & Anywhere To Record Only Water For Ten Days (U.S. Version)
B minor Remain To Record Only Water For Ten Days (U.S. Version)
B minor Representing To Record Only Water For Ten Days (U.S. Version)
C major Untitled #3 Niandra LaDes And Usually Just A T-Shirt
D minor Head (Beach Arab) Niandra LaDes And Usually Just A T-Shirt
D minor Been Insane Niandra LaDes And Usually Just A T-Shirt
D minor Your Pussy’s Glued To A Building On Fire Niandra LaDes And Usually Just A T-Shirt
D minor Wind up Space To Record Only Water For Ten Days (U.S. Version)
D minor Fallout To Record Only Water For Ten Days (U.S. Version)
D# major The First Season To Record Only Water For Ten Days (U.S. Version)
D# minor Untitled #8 Niandra LaDes And Usually Just A T-Shirt
D# minor Untitled #10 Niandra LaDes And Usually Just A T-Shirt
E minor Skin Blues Niandra LaDes And Usually Just A T-Shirt
E minor Blood On My Neck From Success Niandra LaDes And Usually Just A T-Shirt
F major Curtains Niandra LaDes And Usually Just A T-Shirt
F major Untitled #2 Niandra LaDes And Usually Just A T-Shirt
F major Someone’s To Record Only Water For Ten Days (U.S. Version)
F# major Ten To Butter Blood Voodoo Niandra LaDes And Usually Just A T-Shirt
F# minor With No One To Record Only Water For Ten Days (U.S. Version)
F# minor Murderers To Record Only Water For Ten Days (U.S. Version)
G major Untitled #4 Niandra LaDes And Usually Just A T-Shirt
G minor Going Inside To Record Only Water For Ten Days (U.S. Version)
G# minor Big Takeover Niandra LaDes And Usually Just A T-Shirt
G# minor Mascara Niandra LaDes And Usually Just A T-Shirt
G# minor Untitled #9 Niandra LaDes And Usually Just A T-Shirt
G# minor Untitled #13 Niandra LaDes And Usually Just A T-Shirt

Here we have a histogram comparing the keys used in the two albums. It seems Frusciante had a preference for writing songs in A, B, D(major) and G#. B and G# are both close to A, by a whole note and a half note respectively. This could suggest that his vocal range fits best when singing in these keys, or maybe he just has a preference for the sound of them. However there are no songs in G# in To Record Only Water For Ten Days. This could be because of the (lack of) tuning in Niandra Lades and Usually Just A T-Shirt, resulting in some songs that are intentionally in A being read as G# by spotify. Frusciante also has a preference for minor with 29 songs in minor key and 11 in major key. Niandra Lades and Usually Just A T-Shirt has 17 songs in minor and 8 in major, and To Record Only Water For Ten Days has 12 songs in minor and 3 songs in major.